package chapter06;

import java.util.Arrays;
import java.util.Comparator;

public class Test06_Arrays {
    public static void main(String[] args) {
        int[] a = {1,5,2,1,4,5,3,24,2};
        String[] b = {"12","13","5","10"};
        //排序的方法
        Arrays.sort(a);
        Arrays.sort(b, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return Integer.compare(
                        Integer.valueOf(o1),
                        Integer.valueOf(o2));
            }
        });
        //转换成字符串的方法
        System.out.println(Arrays.toString(a));
        System.out.println(Arrays.toString(b));
    }
}
